import 'package:app/common/tool.dart';
import 'package:app/components/base_scaffold_appbar.dart';
import 'package:app/pages/userinfo_module/personal_files_module/personal_files_controller.dart';
import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:get/get.dart';

class PersonalFilesView extends GetView{


  PersonalFilesController controller = Get.put(PersonalFilesController());

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: BaseAppBar(
        preferredSize: Size(Get.width, AppTool.appBarHEIGHT),
        child: Text('个人档案'),
      ),
      body: GetBuilder<PersonalFilesController>(builder: (_){
        return Column(
          children: [
            Container(
              height: 45,
              child: BrnTabBar(
                labelStyle: TextStyle(fontSize: 16),
                controller: controller.tabController,
                tabs: controller.tabs,
              ),
            ),
            Expanded(child:
            TabBarView(
              controller: controller.tabController,
              children: [
                ListView(
                  children: [
                    Divider(
                      color: Colors.transparent,
                    ),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('名字'),
                          Text(controller.model?.data?.baseInfo?.name??''),
                        ],
                      ),
                    ),
                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('性别'),
                          Text(controller.model?.data?.baseInfo?.gender??''),
                        ],
                      ),
                    ),
                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('出生日期'),
                          Text(controller.model?.data?.baseInfo?.birthday??''),
                        ],
                      ),
                    ),

                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('出生地'),
                          Text(controller.model?.data?.baseInfo?.placeOfBirth??''),
                        ],
                      ),
                    ),

                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('电话'),
                          Text(controller.model?.data?.baseInfo?.phone??''),
                        ],
                      ),
                    ),

                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('身份证号'),
                          Text(controller.model?.data?.baseInfo?.identificationId??''),
                        ],
                      ),
                    ),

                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('邮箱'),
                          Text(controller.model?.data?.baseInfo?.email??''),
                        ],
                      ),
                    ),

                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('联系地址'),
                          Text(controller.model?.data?.baseInfo?.address??''),
                        ],
                      ),
                    ),

                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('银行'),
                          Text(controller.model?.data?.baseInfo?.bankAccountName??''),
                        ],
                      ),
                    ),

                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('部门'),
                          Text(controller.model?.data?.baseInfo?.departmentName??''),
                        ],
                      ),
                    ),

                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('国家'),
                          Text(controller.model?.data?.baseInfo?.country??''),
                        ],
                      ),
                    ),

                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('岗位'),
                          Text(controller.model?.data?.baseInfo?.jobName??''),
                        ],
                      ),
                    ),

                    Divider(),



                  ],
                ),
                ListView(
                 children: [
                   Divider(
                     color: Colors.transparent,
                   ),
                   Container(
                     height: 40,
                     padding: EdgeInsets.only(left: 15,right: 15),
                     // color: Colors.yellow,
                     child:Row(
                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
                       children: [
                         Text('学历'),
                         Text(controller.model?.data?.educationInfo?.certificate??''),
                       ],
                     ),
                   ),

                   Divider(),
                   Container(
                     height: 40,
                     padding: EdgeInsets.only(left: 15,right: 15),
                     // color: Colors.yellow,
                     child:Row(
                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
                       children: [
                         Text('专业'),
                         Text(controller.model?.data?.educationInfo?.studyField??''),
                       ],
                     ),
                   ),
                   Divider(),
                   Container(
                     height: 40,
                     padding: EdgeInsets.only(left: 15,right: 15),
                     // color: Colors.yellow,
                     child:Row(
                       mainAxisAlignment: MainAxisAlignment.spaceBetween,
                       children: [
                         Text('学校'),
                         Text(controller.model?.data?.educationInfo?.studySchool??''),
                       ],
                     ),

                   ),
                   Divider(),


                 ],
               ),
                ListView(
                  children: [
                    Divider(
                      color: Colors.transparent,
                    ),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('婚姻状况'),
                          Text(controller.model?.data?.familyInfo?.marital??''),
                        ],
                      ),
                    ),

                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('配偶名称'),
                          Text(controller.model?.data?.familyInfo?.spouseCompleteName??''),
                        ],
                      ),
                    ),
                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('子女数量'),
                          Text('${controller.model?.data?.familyInfo?.children??0}'),
                        ],
                      ),

                    ),
                    Divider(),
                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('紧急联系人'),
                          Text('${controller.model?.data?.familyInfo?.emergencyContact??''}'),
                        ],
                      ),

                    ),
                    Divider(),

                    Container(
                      height: 40,
                      padding: EdgeInsets.only(left: 15,right: 15),
                      // color: Colors.yellow,
                      child:Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text('紧急联系人号码'),
                          Text('${controller.model?.data?.familyInfo?.emergencyPhone??''}'),
                        ],
                      ),

                    ),
                    Divider(),

                  ],
                ),
              ],

            ))
          ],
        );



      }),
    );
  }

}